package com.company.project.component.quartz.factory;

import com.company.project.component.quartz.data.ScheduleJob;
import com.company.project.component.quartz.utils.TaskUtils;
import org.apache.log4j.Logger;
import org.quartz.*;


/**
 * 
 * 有状态的 一般不使用
 * @version V1.0
 * @copyright: 2017 www.jeeweb.cn Inc. All rights reserved.
 *
 */
@DisallowConcurrentExecution
public class QuartzJobFactoryDisallowConcurrentExecution implements StatefulJob
{
	public final Logger log = Logger.getLogger(this.getClass());

	public void execute(JobExecutionContext context) throws JobExecutionException
	{
		ScheduleJob scheduleJob = (ScheduleJob) context.getMergedJobDataMap().get("scheduleJob");
		TaskUtils.invokMethod(scheduleJob);
	}
}